package br.ufrn.geologia.ggemma.model.processor;

import java.util.Date;

import org.jspresso.framework.util.bean.IPropertyChangeCapable;
import org.jspresso.framework.util.bean.integrity.EmptyPropertyProcessor;

import br.ufrn.geologia.ggemma.model.Maintenance;
import br.ufrn.geologia.ggemma.model.MaintenanceExecution;

public class MaintenanceExecutionProcessor extends EmptyPropertyProcessor<MaintenanceExecution, Date> {
	
	public static class MaintenanceExecutionAllPropsProcessor extends EmptyPropertyProcessor<MaintenanceExecution, Date> {
		
		@Override
		public void postprocessSetter(MaintenanceExecution target, Date oldPropertyValue, Date newPropertyValue) {
			super.postprocessSetter(target, oldPropertyValue, newPropertyValue);
			target.getMaintenance().firePropertyChange(Maintenance.DAYS_LEFT, 0, IPropertyChangeCapable.UNKNOWN);
			target.getMaintenance().firePropertyChange(Maintenance.LAST_EXECUTION, 0, IPropertyChangeCapable.UNKNOWN);
			target.getMaintenance().firePropertyChange(Maintenance.EXECUTIONS, null, IPropertyChangeCapable.UNKNOWN);
		}

	}

}
